﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="spm" Namespace="Mystery.SharePoint.WebControls" Assembly="$SharePoint.Project.AssemblyFullName$" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewSPSite.aspx.cs" Inherits="Mystery.SharePoint.Layouts.NewSPSite" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
<asp:Literal ID="Literal1" runat="server" Text="<%$SPMResources:SPM.Foundation,Page_NewSPSite_Title%>" /> 
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
<asp:Literal ID="Literal2" runat="server" Text="<%$SPMResources:SPM.Foundation,Page_NewSPSite_Title%>" /> 
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderPageDescription" runat="server">
    <asp:Literal ID="Literal3" runat="server" Text="<%$SPMResources:SPM.Foundation,Page_NewSPSite_Description%>" />
</asp:Content>


<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

<script language="javascript" type="text/ecmascript">
   
    //Sets a default value in the url field based on the value in the title
    function SetDefaultUrl(str)
    {
        try
        {
            if( document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(TxtSiteUrl.ClientID),Response.Output);%>).value == "" )
            {
                document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(TxtSiteUrl.ClientID),Response.Output);%>).value = 
				str.replace( new RegExp( " ", "g" ), "_" );
            }
        }
        catch(e){};
    }
</script>

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    
    <table width="100%" class="propertysheet" cellspacing="0" cellpadding="0" border="0"> 
		<tr> 
			<td class="ms-descriptionText"> 
				<asp:Label ID="LabelMessage" Runat="server" EnableViewState="False" class="ms-descriptionText"/> 
			</td> 
		</tr> 
		<tr> 
			<td class="ms-error"><asp:Label ID="LabelErrorMessage" Runat="server" EnableViewState="False" /></td> 
		</tr> 
		<tr> 
			<td class="ms-descriptionText"> 
            
				<asp:ValidationSummary 
					ID="ValSummary" 
					HeaderText="<%$SPMResources:SPM.Foundation, Page_NewSPSite_ValidationSummary_HeaderText%>" 
					DisplayMode="BulletList" 
					ShowSummary="True" 
					runat="server" />
			</td> 
		</tr> 
	</table>
	<table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%">
	
	<wssuc:ButtonSection runat="server" TopButtons="true" BottomSpacing="5" ShowSectionLine="false">
		<Template_Buttons>
			<asp:Button 
				UseSubmitBehavior="false" 
				runat="server" 
				class="ms-ButtonHeightWidth" 
				OnClick="BtnCreateSite_Click" 
				Text="<%$Resources:wss,multipages_okbutton_text%>" 
				id="BtnCreateSiteTop" 
				accesskey="<%$Resources:wss,okbutton_accesskey%>" />
		</Template_Buttons>
	</wssuc:ButtonSection>

	<!-- Title and Description -->
	<wssuc:InputFormSection runat="server"
		Title="<%$Resources:wss,scsignup_titledesc_title%>"
		Description="<%$Resources:wss,scsignup_titledesc_description%>"
		id="idTitleDescSection">
		<Template_InputFormControls>
			<wssuc:InputFormControl runat="server"
				LabelText="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Title_Text%>">
				<Template_Control>
					<wssawc:InputFormTextBox 
						title="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Title_ToolTip%>" 
						class="ms-input" 
						ID="TxtSiteTitle" 
						Columns="35" 
						Runat="server" 
						OnBlur="SetDefaultUrl(this.value);"
						MaxLength=255 />
					<wssawc:InputFormRequiredFieldValidator
						ID="ReqValTxtCreateSiteTitle"
						ControlToValidate="TxtSiteTitle"
						ErrorMessage="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Title_ErrorMessage%>"
						Runat="server"/>
				</Template_Control>
			</wssuc:InputFormControl>
			<wssuc:InputFormControl runat="server"
				LabelText="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Description_Text%>">
				<Template_Control>
					<wssawc:InputFormTextBox 
						title="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Description_ToolTip%>" 
						class="ms-input" 
						ID="TxtSiteDescription" 
						Runat="server" 
						TextMode="MultiLine" 
						Columns="40" 
						Rows="3"/>
				</Template_Control>
			</wssuc:InputFormControl>
		</Template_InputFormControls>
	</wssuc:InputFormSection>

    <!-- URL -->
	<wssuc:InputFormSection 
		Title="<%$Resources:wss,scsignup_siteaddress_title%>" 
		runat="server">
        <Template_Description>
			<SharePoint:EncodedLiteral 
                ID="EncodedLiteral1" 
                runat="server" 
                text="<%$Resources:wss,scsignup_siteaddress_desc%>" 
                EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
			<asp:Label 
                id="LabelURLPrefix" 
                runat="server"
                Text="bobo"/><SharePoint:EncodedLiteral 
                ID="EncodedLiteral2" 
                runat="server" 
                text="<%$Resources:wss,scsignup_siteaddress_desc2%>" 
                EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
		</Template_Description>
		<Template_InputFormControls>
			<wssuc:InputFormControl runat="server" LabelText="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Url_Text%>">
				<Template_Control>
				<table dir="ltr" border="0" width="100%" cellspacing="0" cellpadding="0" class="authoringcontrols">
					<tr>
						<td class="ms-descriptiontext" nowrap="nowrap">
							<b><asp:Label runat="server" ID="LblWebApplicationUrl" /> </b>
						</td>
						<td>
							<asp:DropDownList id="DdlUrlPrefixes" runat="server"
								Title="<%$SPMResources:SPM.Foundation, Page_NewSPSite_UrlPrefix_ToolTip%>" />
						</td>
						<td class="ms-descriptiontext">
						<b>/</b>
						</td>
						<td width="100%">
							<wssawc:InputFormTextBox 
								title="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Url_ToolTip%>" 
								class="ms-input" 
								ID="TxtSiteUrl" 
								Columns="18" 
								Runat="server" 
								MaxLength="128" />
						</td>
					</tr>
					<tr>
						<td class="ms-descriptiontext" nowrap="nowrap" colspan="3">
							<wssawc:InputFormRequiredFieldValidator 
								ID="ReqValSiteName" 
								ControlToValidate="TxtSiteUrl"
								ErrorMessage="<%$SPMResources:SPM.Foundation, Page_NewSPSite_Url_ErrorMessage%>" 
								Runat="server"/>
							<wssawc:UrlNameValidator
								ID="CusValSiteName"
								ControlToValidate="TxtSiteUrl"
								runat="server"/>
						</td>
					</tr>
				</table>
				</Template_Control>
			</wssuc:InputFormControl>
		</Template_InputFormControls>
	</wssuc:InputFormSection>

	<!-- Template -->
	<wssuc:InputFormSection 
		title="<%$Resources:wss,templatepick_pagetitle%>" runat="server">
		<Template_Description>
			<asp:Literal ID="Literal4" runat="server" Text="<%$Resources:wss,templatepick_description_label%>" />
		</Template_Description>
		<Template_InputFormControls>
			<wssuc:InputFormControl runat="server" 
                LabelText="<%$Resources:wss,templatepick_templatelist_label%>" LabelAssociatedControlId="WebTemplatePicker">
				<Template_Control>
					<spm:WebTemplatePicker runat="server" ID="WebTemplatePicker" />
				</Template_Control>
			</wssuc:InputFormControl>
		</Template_InputFormControls>
	</wssuc:InputFormSection>

	<!-- Administration -->
	<wssuc:InputFormSection 
	runat="server" 
	Title="<%$SPMResources:SPM.Foundation,Page_NewSPSite_AdminSection_Title%>" 
	Description="<%$SPMResources:SPM.Foundation,Page_NewSPSite_AdminSection_Description%>">
	<template_inputformcontrols>
		<wssuc:InputFormControl 
		LabelText="<%$SPMResources:SPM.Foundation,Page_NewSPSite_Owner_Title%>" runat="server">
			<Template_Control>
				<SharePoint:PeopleEditor 
					class="ms-input" 
					AllowEmpty="false"
					MultiSelect="false" 
					SelectionSet="User" 
					PlaceButtonsUnderEntityEditor="false" 
					ID="PeOwner"
					runat="server" />
			</Template_Control>                          
		</wssuc:InputFormControl> 
	</Template_InputFormControls>
	</wssuc:InputFormSection>


	<wssuc:ButtonSection runat="server" ShowSectionLine="false">
		<Template_Buttons>
			<asp:Button 
				UseSubmitBehavior="false" 
				runat="server" 
				class="ms-ButtonHeightWidth" 
				OnClick="BtnCreateSite_Click" 
				Text="<%$Resources:wss,multipages_okbutton_text%>" 
				id="BtnCreateSite" 
				accesskey="<%$Resources:wss,okbutton_accesskey%>" />
		</Template_Buttons>
	</wssuc:ButtonSection>
   </table>
</asp:Content>

